Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live Viewer shows spectrum of images via caching recent images #2425

Open
wants to merge 29 commits into
base: main
Choose a base branch
from

Conversation

MikeSullivan7
Copy link
Collaborator

@MikeSullivan7 MikeSullivan7 commented Dec 3, 2024

Issue

Closes 2421

Description

An ImageCache has been implemented in the Live Viewer which holds a dictionary of a given size, which image data is stored in. When loaded through the ImageCache, if the image is already in cache, the data is returned without further computation. This provides a performance improvement with compromise of using RAM.

The Live Viewer now has the option to show the spectrum of live data via a right click menu. If the ROI is not moved, the mean spectrum of the newest image is added to the plotted spectrum. If the ROI is moved, all previous images are loaded in a loop, where the mean is stored and plotted. This is done in a separate thread to prevent loss of interaction with the GUI. The calculation of the mean also uses the ImageCache to speed up calculation for those images stored in the cache.

Testing

make check

Acceptance Criteria

Open MI and the Live Viewer Window
Right click and click Operations -> Calculate Spectrum
Move images into LV directory via a script and check that the Spectrum is calculated as expected.
While images are incoming, move the ROI and check that the Spectrum recalculates and plots with no interruption of the GUI.

Documentation

Release Note

Copy link
Collaborator

@samtygier-stfc samtygier-stfc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. I've not been through everything. But here is a first batch of comments.

mantidimaging/eyes_tests/live_viewer_window_test.py Outdated Show resolved Hide resolved
mantidimaging/gui/windows/live_viewer/live_view_widget.py Outdated Show resolved Hide resolved
mantidimaging/gui/windows/live_viewer/live_view_widget.py Outdated Show resolved Hide resolved
mantidimaging/gui/windows/live_viewer/model.py Outdated Show resolved Hide resolved
mantidimaging/gui/windows/live_viewer/model.py Outdated Show resolved Hide resolved
mantidimaging/gui/windows/live_viewer/model.py Outdated Show resolved Hide resolved
mantidimaging/gui/windows/live_viewer/model.py Outdated Show resolved Hide resolved
mantidimaging/gui/windows/live_viewer/model.py Outdated Show resolved Hide resolved
mantidimaging/gui/windows/live_viewer/model.py Outdated Show resolved Hide resolved
@MikeSullivan7 MikeSullivan7 marked this pull request as ready for review December 13, 2024 12:01
…_from_cache_THEN_image_is_not_in_cache and test_WHEN_oldest_image_got_THEN_get_oldest_image
…added_to_cache, test_WHEN_image_in_cache_when_loaded_then_image_taken_from_cache, test_WHEN_cache_full_THEN_loading_image_removes_oldest_image
@coveralls
Copy link

Coverage Status

coverage: 73.193% (-0.5%) from 73.705%
when pulling c0e5875 on live_viewer_caching
into 7997ed7 on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants